﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Scheduling.Models.Interfaces;

namespace Scheduling.Models.Repos.InMemory
{
    public class InMemoryRoomPropertyLoader : IRoomPropertyLoader
    {
        private List<RoomProperty> RoomPropertyList;

        public InMemoryRoomPropertyLoader()
        {
            RoomPropertyList = new List<RoomProperty>();
            RoomProperty prop1 = new RoomProperty() { Name = "Computer", Value = 5 };
            RoomProperty prop2 = new RoomProperty() { Name = "Projector", Value = 1 };
            RoomPropertyList.Add(prop1);
            RoomPropertyList.Add(prop2);
        }



        public List<RoomProperty> GetAllRoomProperties()
        {
            return RoomPropertyList;
        }


        public bool RoomPropertyExists(string name)
        {
            foreach (var p in RoomPropertyList)
            {
                if (p.Name == name)
                    return true;
            }
            return false;
        }

        /*
         * This function cannot be implemented in InMemory since the model of RoomProperty/Property 
         * does not have property "ID"
         * */
        public int GetPropertyID(string name)
        {
            throw new NotImplementedException();
        }

        /*
        * This function cannot be implemented in InMemory since the model of RoomProperty/Property 
        * does not have property "ID"
        * */
        public int GetHighestID()
        {
            throw new NotImplementedException();
        }
    }
}